<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 给button注册事件绑定@click=下一页    v-show显示隐藏条件-->
        <button @click="prevPic" v-show="index>0">上一页</button>
        <div>
            <!-- v-bind属性绑定简写为：图片路径为list里的某下标 -->
          <img :src="list[index]" alt="">
        </div>
        <!-- 给下一页button注册@click=上一页 v-show显示隐藏条件为长度减1 -->
        <button @click="nextPic" v-show="index<list.length-1">下一页</button>
      </div>
      <script src="./vue.js"></script>
      <script>
        const app = new Vue({
          el: '#app',
          data: {
            index:0,
            list: [
              './imgs/11-00.gif',
              './imgs/11-01.gif',
              './imgs/11-02.gif',
              './imgs/11-03.gif',
              './imgs/11-04.png',
              './imgs/11-05.png',
            ]
          },
          methods:{
            prevPic(){
                this.index--
            },
            nextPic(){
                this.index++
            }
          }
        })
      </script>
</body>
</html>